<form class="layui-form seller-form"  action="">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">发货单号：</label>
            <div class="layui-input-inline seller-inline-3">
                <input type="text" name="delivery_id" lay-verify="title"  placeholder="请输入发货单号" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">订单号：</label>
            <div class="layui-input-inline seller-inline-3">
                <input type="text" name="order_id" lay-verify="title" placeholder="请输入订单号" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">快递单号：</label>
            <div class="layui-input-inline seller-inline-3">
                <input type="text" name="logi_no" lay-verify="title" placeholder="请输入快递单号" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">电话号：</label>
            <div class="layui-input-inline seller-inline-3">
                <input type="text" name="mobile" lay-verify="title" placeholder="请输入收货电话号码" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="*"><i class="iconfont icon-chaxun"></i>筛选</button>
        </div>
    </div>
</form>

<div class="table-body">
    <table id="billDelivery" lay-filter="test"></table>
</div>

<script>
    layui.use(['form', 'layedit', 'laydate', 'table'], function(){
        //获取列表数据
        layui.table.render({
            elem: '#billDelivery',
            height: 'full-330',
            cellMinWidth: '80',
            page: 'true',
            limit: '20',
            url: "{:url('billDelivery/index')}?_ajax=1",
            id: 'billDelivery',
            method: 'post',
            response: {
                statusName: 'status',
                statusCode: 1
            },
            cols: [[
                {field:'delivery_id', width:140, title:'发货单号', align:'center', fixed:'left'},
                {field:'order_id', width:140, title:'订单号', align:'center'},
                {field:'username', width:130, title:'用户名', align:'center'},
                {field:'logi_name', width:120, title:'快递公司', align:'center'},
                {field:'logi_no', width:150, title:'快递单号', align:'center'},
                {field:'ship_address', width:260, title:'收货地址', align:'center'},
                {field:'ship_mobile', width:130, title:'收货电话', align:'center'},
                {field:'ctime', width:170, title:'创建时间', align:'center'},
                {field:'operating', title:'操作', width:100, align:'center', fixed:'right',templet:function(data){
                    var html = '';
                    html += '<a  class="layui-btn layui-btn-xs option-view layui-btn-delivery" data-id="' + data.delivery_id + '">明细</a>';
                    return html;
                }}
            ]]
        });

        //搜索操作
        layui.form.on('submit(*)', function(data){
            layui.table.reload('billDelivery', {
                where: data.field
                ,page: {
                    curr: 1 //重新从第 1 页开始
                }
            });
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });

        //查看操作
        $(document).on('click', '.option-view', function(){
            $.ajax({
                type:'get',
                url: "{:url('billDelivery/view')}",
                data:'delivery_id='+$(this).attr('data-id'),
                success:function(e){
                    if(e.status){
                        window.box = layer.open({
                            type: 1,
                            content: e.data,
                            area: ['600px', '600px'],
                            title:'发货单查看'
                        });
                    }else{
                        layer.msg(e.msg);
                    }

                }
            });
        });
    });
</script>
